home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 19
/
AMIGAplus Sonderheft 19 (1999)(ICP)(DE)[!].iso
/
Demoversionen
/
Anwendungen
/
Net_Connect
/
NC_2.1
/
AmIRC
/
Rexx
/
trans.amirx
< prev
Wrap
Text File
|
1999-03-08
|
2KB
|
71 lines
/*
$VER:English/German-Translator 1.4ß (30.05.98) C.Birchinger (Joker)
*/
maxhits=5 /* Default max.hits */
boldtxt=1 /* Use bold */
/* --------------------------------------------------------------*/
parse arg argument
revarg=reverse(argument)
parse var revarg hits word
hits=reverse(hits);word=reverse(word)
if datatype(hits)~='NUM' then do
word=word||hits
hits=maxhits
end
if word='' then do
"echo P="d2c(27)"b«e/g» Usage: trans <words> [<max.hits>]"
exit
end
else hits=strip(hits);word=strip(word)
findword=translate(word,'+',' ')
"echo P="d2c(27)"b«e/g» Translating '"||d2c(2)||word||d2c(2)||"' (Max."hits")"
if open(x,'tcp:131.159.72.7/80') then do
writeln(x,'GET /cgi-bin/dict-search?search='findword'&header=%3F%BF&links=hide&mirrors=%3F%BF')
do until index(line,"search result")>0
line=readln(x)
if eof(x) then do
"echo P="d2c(27)"b«e/g» Search for '"||d2c(2)||word||d2c(2)||"' produced no results."
exit
end
end
parse var line '<STRONG>'foundhits dummy
if foundhits=1 then "echo P="d2c(27)"b«e/g» "foundhits" search result for '"||d2c(2)||word||d2c(2)||"'"
else "echo P="d2c(27)"b«e/g» "foundhits" search results for '"||d2c(2)||word||d2c(2)||"'"
line=readln(x);line=readln(x)
if foundhits>hits then do
foundhits=hits
end
do i=1 to foundhits
line=strip(readln(x))
call htmlout(line)
end
call close(x)
end
else
"echo P="d2c(27)"b«e/g» Error: 'http://www.leo.org/cgi-bin/dict-search' is down or TCP: not mounted."
exit
end
exit
htmlout:
output=arg(1)
parse var output dummy 'VALIGN="TOP">' lines '</TD><TD VALIGN="TOP">' linee
output=lines||'-'||linee
do until (index(output,'<B>')=0)
cut=index(output,'<B>')
if cut~=0 then output=insert(d2c(2),delstr(output,cut,3),cut-1,1)
cut=index(output,'</B>')
if cut~=0 then output=insert(d2c(2),delstr(output,cut,4),cut-1,1)
end
if boldtxt=0 then 'echo P='d2c(27)'b«e/g»' compress(output,d2c(2))
else 'echo P='d2c(27)'b«e/g»' output
return